package com.dm.cloud.file.controller;

import com.dm.cloud.core.mode.ResultModel;
import com.dm.cloud.file.common.model.file.FileModel;
import com.dm.cloud.file.common.model.plugin.PluginUploadMerge;
import com.dm.cloud.file.service.PluginManagerService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/apis/v1/pluginManager")
@Tag(name =  "插件管理服务")
public class PluginManagerController {

    @Autowired
    private PluginManagerService pluginManagerService;



    @PostMapping("pluginShardMerge")
    @Operation(summary = "上传分片文件第三步：合并分片。并上传镜像，返回相对路径")
    public ResultModel<FileModel> shardMerge(@RequestBody PluginUploadMerge pluginUploadMerge){
        FileModel fileModel= pluginManagerService.shardMerge(pluginUploadMerge);
        return ResultModel.success(fileModel);
    }

}
